package com.htht.smartschool.model.fence;

public class Gps {  
	  
    private double wgLat;  
    private double wgLon;  
    public Gps(double wgLon, double wgLat) {  
    	String[] strlat = String.valueOf(wgLat).split("\\.");
    	String[] strlon = String.valueOf(wgLon).split("\\.");
    	String lon = strlon[1];
    	String lat = strlat[1];
    	if(lon.length() > 6){
    		lon = lon.substring(0,6);
    		if(lon.substring(5,6).equalsIgnoreCase("0")){
    			lon= lon.subSequence(0, 5)+ "1";
    		}
    	}
    	if(lat.length() > 6){
    		lat = lat.substring(0,6);
    		if(lat.substring(5,6).equalsIgnoreCase("0")){
    			lat= lat.subSequence(0, 5)+ "1";
    		}
    	}
        setWgLat(Double.valueOf(strlat[0]+"."+lat));  
        setWgLon(Double.valueOf(strlon[0]+"."+lon));  
    }  
    public double getWgLat() {  
        return wgLat;  
    }  
  
    public void setWgLat(double wgLat) {  
        this.wgLat = wgLat;  
    }  
  
    public double getWgLon() {  
        return wgLon;  
    }  
  
    public void setWgLon(double wgLon) {  
        this.wgLon = wgLon;  
    }  
  
    @Override  
    public String toString() {  
        return wgLon + "," + wgLat;  
    }  
}